home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
macros
/
latex209
/
contrib
/
subeqn
/
subeqnarray.doc
(
.txt
)
< prev
next >
Wrap
LaTeX Document
|
1993-11-01
|
8KB
|
162 lines
%%% ====================================================================
%%% @LaTeX-style-file{
%%% author = "Braams J.L.",
%%% version = "2.0",
%%% date = "02 November 1993",
%%% time = "15:06:16 MET",
%%% filename = "subeqnarray.doc",
%%% address = "PTT Research
%%% St. Paulusstraat 4
%%% 2264 XZ Leidschendam
%%% The Netherlands",
%%% telephone = "(70) 3325051",
%%% FAX = "(70) 3326477",
%%% checksum = "23077 186 688 7602",
%%% email = "J.L.Braams@research.ptt.nl (Internet)",
%%% codetable = "ISO/ASCII",
%%% keywords = "",
%%% supported = "yes",
%%% abstract = "This style option defines the subeqnarray
%%% and subeqnarray* environments, which behave
%%% like the eqnarray environment, except that
%%% the lines are numbered like 1a 1b 1c etc.
%%% To refer to these numbers an extra label
%%% command \slabel has been defined
%%% The equations and their numbers adhere to
%%% the standard LaTeX options leqno and fleqn.",
%%% docstring = "The checksum field above contains a CRC-16
%%% checksum as the first value, followed by the
%%% equivalent of the standard UNIX wc (word
%%% count) utility output of lines, words, and
%%% characters. This is produced by Robert
%%% Solovay's checksum utility.",
%%% }
%%% ====================================================================
%\iffalse
% Subeqnarray DOCUMENT-STYLE option -- Version 1.1 released 15 November 1988
% Version 2.0 released 2 November 1993
% for LaTeX version 2.09
% Copyright (C) 1988,1993 by Johannes Braams, Dr Neher Laboratories
% This style option defines the subeqnarray and subeqnarray*
% environment, which behaves like the eqnarray environment,
% except that the lines are numbered like 1a 1b 1c etc.
% To refer to these numbers an extra label command \slabel
% has been defined.
% Many of this code was taken from LaTeX.TeX and modified for
% this purpose.
%\changes{22/12/88}{1.1}{Fixed bug in subeqnarray* environment}
%\makeshortverb`\|
% \begin{macrocode}
\def\fileversion{2.0}
\def\filedate{02 November 1993}
\def\docdate{22/12/1988}
\wlog{Style option `subeqnarray' version \fileversion\space<\filedate> (JLB)}
\wlog{English documentation\space\space\space<\docdate> (JLB)}
% \end{macrocode}
% A new counter for the subequations
% and a command to generate the number
% \begin{macrocode}
\newcounter{subequation}[equation]
\def\thesubequation{\theequation\@alph\c@subequation}
% \end{macrocode}
% |\@subeqnnum=|: Produces the equation number for the
% subeqnarray environment. The following definition is for
% flushright numbers; for flushleft numbers, see leqno.doc.
% The {|\rm ...| } puts the subequation number in roman type even if
% an subeqnarray environment appears in an italic environment.
%\changes{2.0}{2/11/93}{Added test for presence of the leqno option}
% \begin{macrocode}
\ifx\ds@leqno\undefined
\def\@subeqnnum{{\reset@font\rm (\thesubequation)}}
\else
\def\@subeqnnum{\hbox to .01\p@{}\rlap{\reset@font\rm
\hskip -\displaywidth(\thesubequation)}}
% \end{macrocode}
% A new label command to refer to subequations. It works
% like the |\label| command and was taken from \LaTeX.TeX
% |\slabel{FOO}| then writes the following on file |\@auxout| :
% |\newlabel{FOO}{{eval(\@currentlabel)}{eval(\thepage)}}|
% \begin{macrocode}
\def\slabel#1{\@bsphack\if@filesw {\let\thepage\relax
\def\protect{\noexpand\noexpand\noexpand}%
\edef\@tempa{\write\@auxout{\string
\newlabel{#1}{{\thesubequation}{\thepage}}}}%
\expandafter}\@tempa
\if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
% \end{macrocode}
% Here's the subeqnarray environment,
% it steps the equation counter,
% sets the subequation counter equal to 1
% and behaves much like the eqnarray environment.
%\changes{2.0}{2/11/93}{Added test for presence of fleqn style option}
% \begin{macrocode}
\ifx\ds@fleqn\undefined
\def\subeqnarray{%
\stepcounter{equation}%
\let\@currentlabel=\theequation
\global\c@subequation\@ne
\global\@eqnswtrue\m@th
\global\@eqcnt\z@\tabskip\@centering\let\\\@subeqncr
$$\m@th\halign to \displaywidth
\bgroup\@eqnsel\hskip\@centering
$\displaystyle\tabskip\z@{##}$%
&\global\@eqcnt\@ne \hskip 2\arraycolsep \hfil${##}$\hfil
&\global\@eqcnt\tw@ \hskip 2\arraycolsep
$\displaystyle\tabskip\z@{##}$\hfil \tabskip\@centering
&\llap{##}\tabskip\z@\cr}
\else
\def\subeqnarray{%
\stepcounter{equation}%
\let\@currentlabel=\theequation
\global\c@subequation\@ne
\global\@eqnswtrue\m@th
\global\@eqcnt\z@\tabskip\mathindent\let\\\@subeqncr
\abovedisplayskip\topsep
\ifvmode\advance\abovedisplayskip\partopsep\fi
\belowdisplayskip\abovedisplayskip
\belowdisplayshortskip\abovedisplayskip
\abovedisplayshortskip\abovedisplayskip
$$\m@th\halign to \linewidth
\bgroup\@eqnsel\hskip\@centering
$\displaystyle\tabskip\z@{##}$%
&\global\@eqcnt\@ne \hskip 2\arraycolsep \hfil${##}$\hfil
&\global\@eqcnt\tw@ \hskip 2\arraycolsep
$\displaystyle{##}$\hfil \tabskip\@centering
&\llap{##}\tabskip\z@\cr}
\def\endsubeqnarray{\@@subeqncr\egroup
$$\global\@ignoretrue}
\def\@subeqncr{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
\@ysubeqncr}{\global\@eqpen\interdisplaylinepenalty \@ysubeqncr}}
\def\@ysubeqncr{\@ifnextchar [{\@xsubeqncr}{\@xsubeqncr[\z@]}}
\def\@xsubeqncr[#1]{\ifnum0=`{\fi}\@@subeqncr
\noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
\def\@@subeqncr{\let\@tempa\relax
\ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}
\else \def\@tempa{&}\fi
\@tempa \if@eqnsw\@subeqnnum\refstepcounter{subequation}\fi
\global\@eqnswtrue\global\@eqcnt\z@\cr}
% \end{macrocode}
% Here's the subeqnarray* environment:
% \begin{macrocode}
\let\@ssubeqncr=\@subeqncr
\@namedef{subeqnarray*}{\def\@subeqncr{\nonumber\@ssubeqncr}\subeqnarray}
\@namedef{endsubeqnarray*}{\global\advance\c@equation\m@ne%
\nonumber\endsubeqnarray}
% \end{macrocode}
\endinput
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}